<script type="text/javascript" src="${request.contextPath}/assets/js/custom/jquery-console.js"></script>
<link href="${request.contextPath}/assets/css/mem-cloud.css" rel="stylesheet" />
<div class="col-md-12">
  <div class="table-responsive">
    <div id="console" class="console"></div>
    <script type="text/javascript">
      $(document).ready(function () {
        var console = $('#console');
        var controller = console.console({
          promptLabel: 'instanceId:${instanceId!}> ',
          commandValidate: function (line) {
            if (line == "") return false;
            else return true;
          },
          commandHandle: function (line,report) {
            $.ajax({
              url: "${request.contextPath}/admin/instance/commandExecute.json",
              data: {instanceId: $('#instanceId').val(), command: line},
              dataType: "json",
              success: function (result) {
                report([
                  {msg: result.result,
                    className: "jquery-console-message-value"}
                ]);
              }
            });
          },
          autofocus: true,
          animateScroll: true,
          promptHistory: true
        });
      });
    </script>

    <input type="hidden" id="instanceId" value="${instanceId}">
  </div>
</div>
